#ifndef ROUNDEDRECTANGLE_H
#define ROUNDEDRECTANGLE_H

#include "CloseShape.h"

class RoundedRectangle : public CloseShape {
public:
    explicit RoundedRectangle(const QPointF& pos = { 0, 0 });
    RoundedRectangle(const RoundedRectangle& other);

    std::shared_ptr<IShape> clone() const override;
    std::unique_ptr<IShape> init(const QPointF& pos = { 0, 0 }) override;
    QString toSVG() const override;
    static std::unique_ptr<RoundedRectangle> createFromSVG(const QDomElement& element);
    QPainterPath shape() const override;
    std::vector<QPointF> linkPoints() const override;

    void setRadius(qreal radius) { m_radius = radius; }
    qreal radius() const { return m_radius; }

private:
    std::vector<QPointF> getVertices() const;
    qreal m_radius;
};

#endif // ROUNDEDRECTANGLE_H